<?php
	require_once($_SERVER['DOCUMENT_ROOT'].'/ukkepuk/source/php/classes/dao/UserDao.php'); 
    require_once($_SERVER['DOCUMENT_ROOT'].'/ukkepuk/source/php/classes/model/User.php'); 
    
	header("Content-Type:text/xml");  
	$userDao = new UserDao();
	
	echo "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>";
	
	//dispatch kid is the major post file to handle save and load of kid creche info (add food, diper, read kid xml, ...)
	
	
	
	if($_POST['action'] == "saveUser"){
        $user = new User();
        $user->setPassword($_POST['password']);
        $user->setUsername($_POST['username']);
		echo $userDao->saveNewUser($user)->toXml();;
	}

?>